<?php 
echo $this->headLink ();
echo $this->headScript (); 
?>

<script type="text/javascript">
var upload;

window.onload = function() {
	upload = new SWFUpload({
		// Backend Settings
		upload_url: "/admin/upload/upload-image",
		post_params: {"PHPSESSID" : "<?php echo Zend_Session::getId(); ?>", "aid" : "<?php echo $this->albumId ?>"},

		// File Upload Settings
		file_size_limit : "<?php echo $this->config->site->upload->image->maxsize ?>",	// 100MB
		file_types : "*.jpg;*.png;*.gif",
		file_types_description : "JPG, PNG, GIF",
		file_upload_limit : "0",
		file_queue_limit : "0",

		// Event Handler Settings (all my handlers are in the Handler.js file)
		file_queued_handler : fileQueued,
		file_queue_error_handler : fileQueueError,
		upload_start_handler : uploadStart,
		upload_progress_handler : uploadProgress,
		upload_error_handler : uploadError,
		upload_success_handler : uploadSuccess,

		// Button Settings		
		button_image_url : "<?php echo $this->config->site->jsUrl?>swfupload/images/SmallSpyGlassWithTransperancy_17x18.png",
		button_placeholder_id : "spanButtonPlaceholder",
		button_text : '<span class="button"><?php echo $this->translate('admin_upload_select') ?> <span class="buttonSmall"><?php echo $this->translate('admin_upload_select_max') ?></span></span>',
		button_text_style : '.button { font-family: Helvetica, Arial, sans-serif; font-size: 12pt; } .buttonSmall { font-size: 10pt; }',
		button_width: 150,
		button_height: 18,
		button_text_top_padding: 0,
		button_text_left_padding: 18,
		button_window_mode: SWFUpload.WINDOW_MODE.TRANSPARENT,
		button_cursor: SWFUpload.CURSOR.HAND,
		// Flash Settings
		flash_url : "<?php echo $this->config->site->jsUrl?>/swfupload/swfupload.swf",
		custom_settings : {
			progressTarget : "fsUploadProgress",
			cancelButtonId : "btnCancel"
		},
		
		// Debug Settings
		debug: false
	});	
};
</script>
<style>
body {
	margin:0px !important;
}
</style>
<div class="dialog">
	<div class="top">
		<div class="headline upload">
			<h2><?php echo $this->translate('admin_upload_title')?></h2>
			<p class="description"><?php echo $this->translate('admin_upload_description')?></p>
		</div>
	</div>
	<div class="facts" id="facts">
		<?php echo $this->translate('admin_upload_img_valid_type') ?><br>
		<?php echo $this->translate('admin_upload_img_valid_size') ?><br>
		<?php echo $this->translate('admin_upload_img_album') ?>: /files
	</div>
	<div class="body adminform" id="content" style="display: block; overflow: auto; padding:5px" >	
		<div class="fieldset flash" id="fsUploadProgress">
					
		</div>	
		<div>
			<div style="display: inline; border: solid 1px #7FAAFF; background-color: #C5D9FF; padding: 2px;">
				<span id="spanButtonPlaceholder"></span>
			</div>
			<input type="button"  class="btnUpdate" value="<?php echo $this->translate('admin_upload_start_upload') ?>" onclick="upload.startUpload();" 
				style="margin-left: 2px; height: 20px;" />
			<input id="btnCancel" class="btnUpdate" type="button" value="<?php echo $this->translate('admin_form_cancel') ?>" onclick="upload.cancelQueue();"
				disabled="disabled" style="margin-left: 2px; height: 20px;" />
		</div>		
	</div>	
</div>
